package com.yuma.springmcpsseserver.service;

import org.springframework.ai.tool.annotation.Tool;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class StudentService {

    Map<String,Double> studentScore = Map.of(
            "zhangsan",2.0,
            "lisi",3.0,
            "wangwu",3.5
    );
    @Tool(description = "获取学生分数")
    public String getScore(String studentName) {
        if(studentScore.containsKey(studentName)){
            return studentScore.get(studentName).toString();
        }
        return "未检索到当前学生";
    }
}